Blockly.defineBlocksWithJsonArray([{
    "type": "weekday_block",
    "message0": "星期 %1",
    "args0": [
    {
        "type": "field_dropdown",
        "name": "WEEKDAY",
        "options": [
            ["日", "0"],
            ["一", "1"],
            ["二", "2"],
            ["三", "3"],
            ["四", "4"],
            ["五", "5"],
            ["六", "6"]           
          ]
    }
    ],
    // "inputsInline": true,
    "output": "Number",
    "colour": "%{BKY_LOOPS_HUE}"
  }]);

    
  Blockly.Lua['weekday_block'] = function(block) {
  
    var weekday = block.getFieldValue('WEEKDAY');

    var code = weekday;
    var order = Blockly.Lua.ORDER_NONE;  // ORDER_xxx 是指优先级

    return [code,order]; // 很多时候要return一个包含代码和优先级的数组 
  };
  
  
  